import redis
import time
conn = redis.Redis()
while True:
    num = conn.get("per_min_num")
    print("队列长度%s" % conn.llen("jiaoyi"))
    if not num:
        num =90 
    else:
        num = int(num)
    print("每分钟交易量%s" % num)
    num = 900
    print("每分钟交易量%s" % num)
    sleep_time = 60 / num
    for i in range(num):
        if conn.llen("jiaoyi") < 100000:
            conn.rpush("jiaoyi", "1")
            time.sleep(sleep_time)
